package com.qcby.controller;

import com.qcby.Constants;
import com.qcby.model.HallSeatArray;
import com.qcby.model.dto.HallSeatArrayQueryDto;
import com.qcby.model.resp.RespEntity;
import com.qcby.service.HallSeatArrayService;
import com.qcby.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hallSeat")
public class HallSeatArrayController {
    @Autowired
    private HallSeatArrayService hallSeatArrayService;

    @RequestMapping("/selectCondition")
    public RespEntity<Page<HallSeatArray>> selectCondition(@RequestBody HallSeatArrayQueryDto queryDto) {
        if (queryDto.getPageNo() == null) {
            queryDto.setPageNo(1);
        }
        Page<HallSeatArray> hallSeatArrayList = hallSeatArrayService.selectConditionPage(queryDto);
        return RespEntity.successCustomize(Constants.FLAG_200, "查询场次座位信息成功！",hallSeatArrayList
                );
    }
}
